#include "stdafx.h"
#include "ProcessInformation.h"

#include <Windows.h>
#include <Psapi.h>
#include "HandleGuard.h"

namespace GenericFilter
{
    namespace Process
    {
        std::list<ProcessInformation> GenericFilter::Process::ProcessInformation::allProcesses()
        {
            DWORD processIds[1024];
            DWORD sizeNeed;
            ::EnumProcesses(processIds, sizeof(processIds), &sizeNeed);

            int n = sizeNeed / sizeof(DWORD);
            for (int i = 0; i < n ; i++)
            {
            	
            }
        }

        GenericFilter::Process::ProcessInformation ProcessInformation::fromProcessId(uint64_t id)
        {
            HandleGuard process(::OpenProcess(PROCESS_QUERY_INFORMATION | PROCESS_VM_READ, false, static_cast<DWORD>(id)));

            // #TODO: query process name & something else
            ::QueryProcess
        }

    }
}